﻿<Page x:Class="SsTool.Core.ApplicationListPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:parts="clr-namespace:SsTool.Core.Parts"
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="600"
	Title="ApplicationListPage">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.ColumnSpan="2" Orientation="Horizontal">
            <Button Name="_ctlAdd" Margin="5,5,0,5" Click="_ctlAdd_Click">
                <StackPanel Orientation="Horizontal">
                    <Image Source="../Resources/add.png"/>
                    <TextBlock Text="添加" VerticalAlignment="Center"/>
                </StackPanel>
            </Button>
            <Button Name="_ctlEdit" Margin="5,5,0,5" Click="_ctlEdit_Click">
                <StackPanel Orientation="Horizontal">
                    <Image Source="../Resources/properties.png"/>
                    <TextBlock Text="修改" VerticalAlignment="Center"/>
                </StackPanel>
            </Button>
            <Button Name="_ctlDelete" Margin="5,5,0,5" Click="_ctlDelete_Click">
                <StackPanel Orientation="Horizontal">
                    <Image Source="../Resources/delete.png"/>
                    <TextBlock Text="删除" VerticalAlignment="Center"/>
                </StackPanel>
            </Button>
        </StackPanel>
        <DataGrid Grid.Row="1" Grid.Column="0" Name="_ctlGrid" IsReadOnly="True" AutoGenerateColumns="False" SelectionChanged="_ctlGrid_SelectionChanged">
            <DataGrid.Columns>
                <DataGridTextColumn Header="名称" Binding="{Binding Name}" Width="*"/>
                <DataGridTextColumn Header="排序号" Binding="{Binding Path=SortIndex}" Width="*"/>
                <DataGridTemplateColumn>
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Content="设置权限" Hyperlink.Click="DataGridHyperlinkColumn_Click"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
            </DataGrid.Columns>
        </DataGrid>
        <TabControl Grid.Row="1" Grid.Column="1">
            <TabItem Header="相关模块">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" Orientation="Horizontal">
                        <Button Content="添加模块" Name="_ctlBtnAddModule" Margin="0,5,0,5" Click="_ctlBtnAddModule_Click" />
                        <Button Content="删除模块" Name="_ctlBtnRemoveModule" Margin="0,5,0,5" Click="_ctlBtnRemoveModule_Click" />
                    </StackPanel>
                    <DataGrid Name="_ctlGridModules" Grid.Row="1" AutoGenerateColumns="False" IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="模块名称" Binding="{Binding Caption}"/>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
            </TabItem>
            <TabItem Header="导航列表">
                <parts:NavigationPart x:Name="_ctlNavigationPart"/>
            </TabItem>
            <TabItem Header="快捷方式列表">
                <parts:ShortcutsPart x:Name="_ctlShortcutsPart"/>
            </TabItem>
        </TabControl>
    </Grid>
</Page>
